/*
 * @Author: szx
 * @Date: 2021-11-16 13:01:56
 * @LastEditTime: 2021-11-16 13:11:44
 * @Description:
 * @FilePath: \leetcode\1-99\78\78.go
 */
package main

func subsets(nums []int) [][]int {
	n := len(nums)
	res := [][]int{}
	for i := 0; i < (1 << n); i++ {
		t := []int{}
		for j := 0; j < len(nums); j++ {
			if i&(1<<j) > 0 {
				t = append(t, nums[j])
			}
		}
		res = append(res, t)
	}
	return res
}
